function splitData(rawData) {
	var datas = [];
	var times = [];
	for (var i = 0; i < rawData.length; i++) {
		datas.push(rawData[i].splice(1, 2)[0]);
		times.push(rawData[i].splice(0, 1)[0]);
	}
	return {
		datas: datas,
		times: times
	};
}
//上证指数，深证指数，创业扳指
var myChart1 = echarts.init(document.getElementById('echar1'));
var myChart2 = echarts.init(document.getElementById('echar2'));
var myChart3 = echarts.init(document.getElementById('echar3'));
// 指定图表的配置项和数据
var data1 = splitData([
	["2019-01-10 12:10", 2333.45],
	["2019-01-10 12:11", 2334.44],
	["2019-01-10 12:12", 2335.47],
	["2019-01-10 12:13", 2303.79],
	["2019-01-10 12:14", 2343.44],
	["2019-01-10 12:15", 2293.45],
	["2019-01-10 12:15", 2297.46],
	["2019-01-10 12:15", 2313.45],
	["2019-01-10 12:15", 2333.45],
	["2019-01-10 12:15", 2338.35],
	["2019-01-10 12:15", 2303.45],
	["2019-01-10 12:15", 2289.89],
	["2019-01-10 12:15", 2343.55],
	["2019-01-10 12:15", 2344.44],
	["2019-01-10 12:15", 2363.44]
]);
var data2 = splitData([
	["2019-01-10 12:10", 2333.45],
	["2019-01-10 12:11", 2334.44],
	["2019-01-10 12:12", 2335.47],
	["2019-01-10 12:13", 2303.79],
	["2019-01-10 12:14", 2383.45],
	["2019-01-10 12:15", 2293.45],
	["2019-01-10 12:15", 2297.46],
	["2019-01-10 12:15", 2313.45],
	["2019-01-10 12:15", 2333.45],
	["2019-01-10 12:15", 2338.35],
	["2019-01-10 12:15", 2303.45],
	["2019-01-10 12:15", 2283.45],
	["2019-01-10 12:15", 2343.55],
	["2019-01-10 12:15", 2344.44],
	["2019-01-10 12:15", 2363.44],
	["2019-01-10 12:15", 2144.44],
	["2019-01-10 12:15", 2343.44]
]);
var data3 = splitData([
	["2019-01-10 12:10", 2333.45],
	["2019-01-10 12:11", 2334.44],
	["2019-01-10 12:12", 2335.47],
	["2019-01-10 12:13", 2303.79],
	["2019-01-10 12:14", 2383.45],
	["2019-01-10 12:15", 2293.45],
	["2019-01-10 12:15", 2297.46],
	["2019-01-10 12:15", 2313.45],
	["2019-01-10 12:15", 2333.45],
	["2019-01-10 12:15", 2338.35],
	["2019-01-10 12:15", 2303.45]
]);
var option1 = {
	tooltip: {
		trigger: 'axis'
	},
	grid: {
		left: 0,
		right: 50,
		top: 10,
		bottom: 1
	},
	xAxis: {
		axisLine: { //轴线
			show: false,
		},
		axisTick: { //轴线刻度
			show: false,
		},
		axisLabel: { //轴线值
			show: false,
		},
		boundaryGap: false,
		data: data1.times
	},
	yAxis: {
		type: 'value',
		position: 'right',
		axisLine: { //轴线
			show: false,
		},
		axisTick: { //轴线刻度
			show: false,
		},
		axisLabel: { //轴线值
			showMaxLabel: false,
			verticalAlign: 'bottom',
			color: '#999999',
			fontSize: '12',
			formatter: function(data) {
				return parseInt(data);
			}
		},
		splitLine: {
			show: false,
		},
		min: function(value) {
			return value.min;
		},
		max: function(value) {
			return value.max;
		}
	},
	series: {
		name: '销量',
		type: 'line',
		showSymbol: false,
		symbolSize: 1,
		smooth: true,
		itemStyle: {
			color: '#599ee1',
		},
		lineStyle: {
			width: 1,
			color: '#599ee1',
		},
		areaStyle: {
			color: '#e7f1fb',
		},
		data: data1.datas
	}
};
var option2 = {
	tooltip: {
		trigger: 'axis'
	},
	grid: {
		left: 0,
		right: 50,
		top: 10,
		bottom: 1
	},
	xAxis: {
		axisLine: { //轴线
			show: false,
		},
		axisTick: { //轴线刻度
			show: false,
		},
		axisLabel: { //轴线值
			show: false,
		},
		boundaryGap: false,
		data: data2.times
	},
	yAxis: {
		type: 'value',
		position: 'right',
		axisLine: { //轴线
			show: false,
		},
		axisTick: { //轴线刻度
			show: false,
		},
		axisLabel: { //轴线值
			showMaxLabel: false,
			verticalAlign: 'bottom',
			color: '#999999',
			fontSize: '12',
			formatter: function(data) {
				return parseInt(data);
			}
		},
		splitLine: {
			show: false,

		},
		min: function(value) {
			return value.min;
		},
		max: function(value) {
			return value.max;
		},
	},
	series: {
		name: '销量',
		type: 'line',
		showSymbol: false,
		symbolSize: 1,
		smooth: true,
		itemStyle: {
			color: '#599ee1',
		},
		lineStyle: {
			width: 1,
			color: '#599ee1',
		},
		areaStyle: {
			color: '#e7f1fb',
		},
		data: data2.datas
	}
};
var option3 = {

	tooltip: {
		trigger: 'axis'
	},
	grid: {
		left: 0,
		right: 50,
		top: 10,
		bottom: 1
	},
	xAxis: {
		axisLine: { //轴线
			show: false,
		},
		axisTick: { //轴线刻度
			show: false,
		},
		axisLabel: { //轴线值
			show: false,
		},
		boundaryGap: false,
		data: data3.times
	},
	yAxis: {
		type: 'value',
		position: 'right',
		axisLine: { //轴线
			show: false,
		},
		axisTick: { //轴线刻度
			show: false,
		},
		axisLabel: { //轴线值
			showMaxLabel: false,
			verticalAlign: 'bottom',
			color: '#999999',
			fontSize: '12',
			formatter: function(data) {
				return parseInt(data);
			}
		},
		splitLine: {
			show: false,

		},
		min: function(value) {
			return value.min;
		},
		max: function(value) {
			return value.max;
		}
	},
	series: {
		name: '销量',
		type: 'line',
		showSymbol: false,
		symbolSize: 1,
		smooth: true,
		itemStyle: {
			color: '#599ee1',
		},
		lineStyle: {
			width: 1,
			color: '#599ee1',
		},
		areaStyle: {
			color: '#e7f1fb',
		},
		data: data3.datas
	}
};
// 使用刚指定的配置项和数据显示图表。
myChart1.setOption(option1);
myChart2.setOption(option2);
myChart3.setOption(option3);
